package com.iqiju.guagua.redtone.video.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Date;

@Data
@TableName("wx_mini_user")
public class WxMiniUser implements UserDetails {

    @TableId
    private Long id;

    @TableField("wx_mini_app_id")
    private Long wxMiniAppId;

    private String openid;

    private String unionid;

    @TableField("nick_name")
    private String nickName;

    @TableField("avatar_url")
    private String avatarUrl;

    private String gender;

    private String country;

    private String province;

    private String city;

    private String language;

    @TableField("create_time")
    private Date createTime;

    @TableField("channel_id")
    private String channelId;

    @TableField("share_user_id")
    private Long shareUserId;




    @TableField(exist = false)
    private String username = "admin";

    @TableField(exist = false)
    private String password = "admin";

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
